<template>
  <view class="service-description">
    <view class="service-section-title">
      <text class="service-section-title-text">服务介绍</text>
    </view>
    <view class="description-content">
      <text>{{ description }}</text>
    </view>
    
    <view class="service-section-title" v-if="notices && notices.length">
      <text class="service-section-title-text">服务须知</text>
    </view>
    <view class="service-notice" v-if="notices && notices.length">
      <view
        v-for="(notice, index) in notices"
        :key="index"
        class="notice-item"
      >
        <text class="notice-icon">•</text>
        <text class="notice-text">{{ notice }}</text>
      </view>
    </view>
  </view>
</template>

<script setup>
import { defineProps } from 'vue';

const props = defineProps({
  /**
   * 服务描述
   */
  description: {
    type: String,
    default: ''
  },
  /**
   * 服务须知列表
   */
  notices: {
    type: Array,
    default: () => []
  }
});
</script>

<style lang="scss" scoped>
.service-description {
  background-color: #fff;
  padding: 20px;
  border-radius: 16px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  margin-bottom: 12px;
}

.service-section-title {
  margin-bottom: 15px;
  position: relative;
}

.service-section-title-text {
  font-size: 18px;
  font-weight: 600;
  color: #222;
  position: relative;
  display: inline-block;
  padding-left: 12px;
  
  &::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 18px;
    background-color: #07c160;
    border-radius: 2px;
  }
}

.description-content {
  font-size: 15px;
  color: #555;
  line-height: 1.6;
  margin-bottom: 20px;
  text-align: justify;
}

.service-notice {
  padding: 0 5px;
}

.notice-item {
  display: flex;
  margin-bottom: 12px;
  font-size: 14px;
  color: #555;
  line-height: 1.5;
  
  &:last-child {
    margin-bottom: 0;
  }
}

.notice-icon {
  margin-right: 8px;
  color: #07c160;
  font-size: 16px;
  line-height: 1.5;
}

.notice-text {
  flex: 1;
}
</style>
